package com.share.api.rule.api;

import com.share.api.rule.domain.FeeRule;
import com.share.api.rule.domain.FeeRuleRequestForm;
import com.share.api.rule.domain.FeeRuleResponseVo;
import com.share.api.rule.factory.RemoteFeeRuleFallbackFactory;
import com.share.common.core.constant.ServiceNameConstants;

import com.share.common.core.domain.R;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


@FeignClient(contextId = "remoteFeeRuleService", value = ServiceNameConstants.SHARE_RULE, fallbackFactory = RemoteFeeRuleFallbackFactory.class)
public interface RemoteFeeRuleService {


    /** 获取费用规则详细信息*/
    @GetMapping(value = "/feeRuleApi/getFeeRule/{id}")
    public R<FeeRule> getFeeRule(@PathVariable("id") Long id);

    /** 计算订单费用 */
    @PostMapping(value = "/feeRuleApi/calculateOrderFee")
    public R<FeeRuleResponseVo> calculateOrderFee(@RequestBody FeeRuleRequestForm feeRuleRequestForm);

    /*
    * 批量获取规则数据列表远程调用
    * */
    @PostMapping(value = "/feeRuleApi/getFeeRuleList")
    public R<List<FeeRule>> getFeeRuleList(@RequestBody List<Long> feeRuleIdList);
}
